<template>
        <div class="modal fade" id="copyReportModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                        <h4 class="modal-title" id="myModalLabel">复制内容</h4>
                    </div>
                    <div class="modal-body">
                        <div ><pre>{{copyReportModal}}</pre></div>
                    </div>
                    <div class="modal-footer">
                        <!--<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>-->
                        <!--<button type="button" class="btn checkedBtn"  @click="copy">确定</button>-->
                        <button type="button" class="btn checkedBtn"
                                v-clipboard:copy="copyReportModal"
                                v-clipboard:success="onCopy"
                                v-clipboard:error="onError">确定</button>
                    </div>
                </div>
            </div>
        </div>
</template>

<script>
    export default {
        name: "copy-report",
        props: ["copyReportModal"],
        methods:{
            onCopy(){
                console.log(this.copyReportModal);
                layer.msg('复制成功')
            },
            onError(){
                layer.msg("复制失败，请手动复制")
            }
        }
    }
</script>

<style scoped>

</style>